import { useEffect, useState } from 'react'
import { getChannelListAPI } from '@/apis/artical'


const useChannel = () => {
  //获取文章频道列表
  const [channelList, setChannelList] = useState([])
  useEffect(() => {
    const getChannelList = async () => {
      const res = await getChannelListAPI()
      setChannelList(res.data.data.channels)
    }
    getChannelList()
  }, [])

  return {
    channelList
  }
}

export {
  useChannel
}